package com.cloudbroker.bcs.platform.ltb.bizapi.constants.type;

/**
 * Created by zhaosh19213 on 2016/8/4.
 */
public enum CommentType {
    COMBINATION("1","组合评论"),
    ;

    private final String val;

    private final String description;

    private String toString;

    CommentType(String val, String description) {
        this.val = val;
        this.description = description;
    }

    public static CommentType getByValue(Integer val) {
        for(CommentType type : values()) {
            if( val.equals(type.getVal()) ) {
                return type;
            }
        }
        return null;
    }

    public String getVal() {
        return val;
    }

    public String getDescription() {
        return description;
    }

    @Override
    public String toString() {
        if (null == toString) {
            toString = new StringBuilder().append("CommentType[").append(val).append(':').append(description)
                    .append(']').toString();
        }
        return toString;
    }
}
